package CAO2Demo.Getter和Setter;

public class GetterNSetter {
    private int a = 10;
    private double b = 3.14;

    public int getA() {
        return a;
    }

    public void setA(int a) {
        this.a = a;
    }

    public double getB() {
        return b;
    }

    public void setB(double b) {
        this.b = b;
    }
}
class Run {
    public static void main(String[] args) {
        GetterNSetter C = new GetterNSetter();
        C.setA(20);
        C.setB(4.1);
        System.out.println(C.getA());
        System.out.println(C.getB());
    }
}


